package c_000;


import java.util.concurrent.TimeUnit;

public class T00_WhatIsThread {

    private static class T1 extends Thread{

        @Override
        public void run() {
            for(int i = 0; i < 10; i++){
                try {
                    TimeUnit.MICROSECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("T1");
            }
        }
    }

    public static void main(String[] args) {
//        new T1().run();
        new T1().start();
        for(int i = 0; i < 10; i++){
            try {
                TimeUnit.MICROSECONDS.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("main");
        }
    }
}
//直接调用线程的run()和通过start()调用线程有什么区别?
//run()的调用使用的是main主线程,start()会开启一个新线程执行
